﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Get : History User Guide</title>

<style type='text/css' media='all'>@import url('../css/userguide.css');</style>
<link rel='stylesheet' type='text/css' media='all' href='../css/userguide.css' />

<meta http-equiv='expires' content='-1' />
<meta http-equiv= 'pragma' content='no-cache' />
<meta name='robots' content='all' />

</head>

<body>

<!-- START NAVIGATION -->
<div id="nav"><div id="nav_inner"></div></div>
<div id="nav2"><a name="top">&nbsp;</a><a id="nav_toggle" href="#"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td><h1>History</h1></td>
<td id="breadcrumb_right"><a href="toc.html">Table of Contents Page</a></td>
</tr>
</table>
</div>
<!-- END NAVIGATION -->

<!-- START BREADCRUMB -->
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td id="breadcrumb">
<a href="http://stensi.com/">History Home</a> &nbsp;&#8250;&nbsp;
<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
Get
</td>
</tr>

</table>
<!-- END BREADCRUMB -->

<br clear="all" />


<!-- START CONTENT -->
<div id="content">


<h1>Get</h1>

<p>Get returns the URL of the current page or the specified number of pages back in the history.</p>

<h2>Parameters</h2>

<p>Get has two optional parameters that it accepts.</p>

<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td class="td"><strong>Pages</strong></td>
<td class="td">Integer</td>
<td class="td">The number of pages back into the history.</td>
<td class="td">0</td>
</tr>
<tr>
<td class="td"><strong>As Array</strong></td>
<td class="td">Boolean</td>
<td class="td">If set to TRUE, will return an array of the history, from the oldest page, up to the current page or the specified number of pages back in the history.</td>
<td class="td">FALSE</td>
</tr>
</table>

<h2>Return</h2>

<p>Get has two possible types of values it returns, depending on the parameter values supplied.</p>

<ul>
	<li>If no parameter values are supplied, or only the first parameter value is supplied, a string containing the URL for the corresponding page in the history will be returned.</li>
	<li>If the second parameter is supplied as TRUE, an array is returned.</li>
</ul>


<h2>Examples</h2>

<p>Retrieve the URL of the current page.</p>

<code>$url = $this->history->get();</code>

<p>This is identical to:</p>

<code>$url = $this->history->get(0);</code>

<p>To retrieve the URL of the previous page, we look 1 page back.</p>

<code>$url = $this->history->get(1);</code>

<p>Obviously it's easy to go from there and know that supplying 2 will get the URL 2 pages back into the history and so on.</p>

<p>If for some reason you wanted it get an array, you can do:</p>

<code>$array = $this->history->get(3, TRUE);</code>

<p>This will give you an array containing the oldest page in the history up to the specified number of pages back, which in the above case is 3 pages back. I doubt you'll need to get an array very much, if at all, since this is primarily for internal use by History.</p>



</div>
<!-- END CONTENT -->


<div id="footer">
<p>
Previous Topic:&nbsp;&nbsp;<a href="config.html">Configuration</a>
&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
Next Topic:&nbsp;&nbsp;<a href="save.html">Save</a>
</p>
<p><a href="http://stensi.com">History</a> &nbsp;&middot;&nbsp; Copyright &#169; 2008 &nbsp;&middot;&nbsp; <a href="http://stensi.com/">Simon Stenhouse</a></p>
<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006-2008 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
</div>

<script type="text/javascript" src="../js/mootools.js"></script>
<script type="text/javascript" src="../js/menu.js"></script>
<script type="text/javascript">
<!--
	window.addEvent('domready', function() {

		// Create Menu
		var menu = new Menu({
			basepath: '../',
			pagepath: ''
		});

	});	
//-->
</script>
</body>
</html>